﻿using System.Collections.Generic;

namespace lhservice.Models
{
  /// <summary>
  /// 客服消息会话
  /// </summary>
  public class Session
  {
    public string Session_id { set; get; }
    public string Customer_id { set; get; }
    public string Create_id { set; get; }

  }

  public class AskRecord
  {
    public string aid { get; set; }
    public string openid { set; get; }
    public string Ask { get; set; }
    public string Sender { get; set; }
    public string Phone { get; set; }
    public string IsDependRemote { get; set; }
    public string RemoteType { get; set; }
    public string RemoteAccount { get; set; }
    public string RemoteAuth { get; set; }
    public string IsWinAuth { get; set; }
    public string WinUser { get; set; }
    public string WinPwd { get; set; }
    public string session_id { get; set; }
  }


  /// <summary>
  /// 发送给客户的消息模型
  /// </summary>
  public class MsgToCustomer
  {
    public string touser { set; get; }
    public string msgtype { set; get; }
    public MsgToCustomerLink link { set; get; }
    public MsgToCustomerText text { set; get; }
    public MsgToCustomerImage image { set; get; }
    public MsgToCustomerMpLink miniprogrampage { set; get; }

  }

  public class MsgToCustomerLink
  {
    public string title { set; get; }
    public string description { set; get; }
    public string url { set; get; }
    public string thumb_url { set; get; }
  }

  public class MsgToCustomerText
  {
    public string content { set; get; }
  }

  public class MsgToCustomerImage
  {
    public string media_id { set; get; }
  }

  public class MsgToCustomerMpLink
  {
    public string title { set; get; }
    public string pagepath { set; get; }
    public string thumb_media_id { set; get; }
  }


  /// <summary>
  /// 最终存储的消息模型
  /// 适用：1、微信服务器推送来的 2、客服发送给客户成功后保存的
  /// </summary>
  public class MsgOfSave
  {
    /// <summary>
    /// 会话编号
    /// </summary>
    public string SessionId { get; set; }

    /// <summary>
    /// 消息序号
    /// </summary>
    public long OrderNum { get; set; }

    /// <summary>
    /// 消息方向 c2s/s2c
    /// </summary>
    public string Dir { get; set; }

    /// <summary>
    /// 会话编号
    /// </summary>
    public string CustomerId { get; set; }

    /// <summary>
    /// 入档时间
    /// </summary>
    public long AddTime { get; set; }

    /// <summary>
    /// 消息状态 0：未转发，-1：发送失败，1：存档
    /// </summary>
    public long State { set; get; }

    /// <summary>
    /// 小程序的原始ID
    /// </summary>
    public string ToUserName { set; get; }

    /// <summary>
    /// 发送者的openid
    /// </summary>
    public string FromUserName { set; get; }

    /// <summary>
    /// 事件创建时间(整型）
    /// </summary>
    public long CreateTime { set; get; }

    /// <summary>
    /// 事件类型 用户点击客服按钮：user_enter_tempsession
    /// </summary>
    public string Event { set; get; }

    /// <summary>
    /// 用户点击客服按钮：sessionFrom 传参
    /// </summary>
    public string SessionFrom { set; get; }

    /// <summary>
    /// 消息类型 text image miniprogrampage
    /// </summary>
    public string MsgType { set; get; }

    /// <summary>
    /// 消息id，64位整型
    /// </summary>
    public long MsgId { set; get; }

    /// <summary>
    /// 文本消息内容
    /// </summary>
    public string Content { set; get; }

    /// <summary>
    /// 图片链接
    /// </summary>
    public string PicUrl { set; get; }

    /// <summary>
    /// 图片消息媒体id，可以调用[获取临时素材]((getTempMedia)接口拉取数据。
    /// </summary>
    public string MediaId { set; get; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { set; get; }

    /// <summary>
    /// 小程序appid
    /// </summary>
    public string AppId { set; get; }

    /// <summary>
    /// 小程序页面路径
    /// </summary>
    public string PagePath { set; get; }

    /// <summary>
    /// 封面图片的临时cdn链接
    /// </summary>
    public string ThumbUrl { set; get; }

    /// <summary>
    /// 封面图片的临时素材id
    /// </summary>
    public string ThumbMediaId { set; get; }
  }

  /// <summary>
  /// 客服客户端发来的消息模板
  /// </summary>
  public class MsgFromClient
  {
    public string StationId { get; set; }
    public string Station { get; set; }

    /// <summary>
    /// 指令类型
    /// </summary>
    public string action { get; set; }
    /// <summary>
    /// 消息内容
    /// </summary>      
    public string session_id { get; set; }
    public string userid { get; set; }
    public string username { get; set; }
    public string password { get; set; }
    public string callBackId { get; set; }
    public string msgtext { get; set; }
    public MsgToCustomer msg { get; set; }
  }


  /// <summary>
  /// 客服发送消息的状态
  /// </summary>
  public class MsgSendState
  {
    public string session_id { set; get; }
    public string callBackId { set; get; }
    public string state { set; get; }
    public string statedetail { set; get; }
  }

  public class PushTarget
  {
    public List<string> clientlis { get; set; }
    public string lineid { get; set; }
    public string msgtype { get; set; }
    public string msg { get; set; }
  }


}
